package yhao.demo.autocode.demo;

import yhao.demo.autocode.core.sqlmapper.SqlModuleMapHelper;
import yhao.demo.autocode.core.sqlmapper.SqlToDocxHelper;
import yhao.demo.autocode.core.sqlmapper.connect.DbConnectParam;
import yhao.demo.autocode.core.sqlmapper.connect.DbType;

/**
 * 数据库表直接转换成数据库对象映射文档
 *
 * <p>数据库表信息
 *
 * @see SqlModuleMapHelper
 */
public class DbToDocxTest {
    public static void main(String[] args) throws Exception{
        //testOracleToDocx();
        testMysqlSqlToDocx();
    }
    public static void testOracleToDocx() throws Exception {
        DbConnectParam param = new DbConnectParam(DbType.ORACLE,
                "jdbc:oracle:thin:@ (DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.44)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = qftest44)))",
                "yhao_base","yhao_base");
        SqlToDocxHelper docx = new SqlToDocxHelper(param,"","T_BACKLOG_ASSIGNER");
        docx.doMapper();
    }

    public static void testMysqlSqlToDocx() throws Exception {
        DbConnectParam param = new DbConnectParam(DbType.MYSQL,
                "jdbc:mysql://192.168.0.155:4000/yhao?useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=round",
                "root","yhao.com");
        SqlToDocxHelper docx = new SqlToDocxHelper(param,"yhao","t_oa_notify_message");
        docx.doMapper();
    }
}
